[USER STORY] Add input validation to WordGuessGame #25#144
Open
hchagerman wants to merge 40 commits intoMetroCS:mainfrom
Open
[USER STORY] Add input validation to WordGuessGame #25#144hchagerman wants to merge 40 commits intoMetroCS:mainfrom
hchagerman wants to merge 40 commits intoMetroCS:mainfrom
Conversation
name Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Update README.md
added name
added my name
add if Score == null Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Update GameHistoryTracker.java
Signed-off-by: CamCranda11 <159499223+CamCranda11@users.noreply.github.com>
Signed-off-by: CamCranda11 <159499223+CamCranda11@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Contributor
jody
requested changes
Nov 1, 2025
Contributor
There was a problem hiding this comment.
Why does input validation to WordGuessGame involve changes to JottoGame.java?
|
|
||
| public String GuessData(String guess){ | ||
| int guessLength = guess.length(); | ||
| if (guessLength != 5 || !guess.matches("[a-zA-Z0-9]{5}")){ |
Contributor
There was a problem hiding this comment.
Why are numerals included in input validation? The Acceptance Criteria for #25 indicates that only "alphabetic" inputs are accepted and more specifically: "reject inputs that contain numbers".
| public String GuessData(String guess){ | ||
| int guessLength = guess.length(); | ||
| if (guessLength != 5 || !guess.matches("[a-zA-Z0-9]{5}")){ | ||
| System.out.println("your guess needs to be 5 letters long"); |
Contributor
There was a problem hiding this comment.
If the guess is length 5 but contains non-letters, this is a misleading error message.
Comment on lines
+39
to
+40
| assertTrue(result.isPresent()); | ||
| assertEquals(5, result.get()); |
Contributor
There was a problem hiding this comment.
How does this test whether input is valid or not?
Contributor
|
Too many commits to review; not all appear to be relevant. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

[USER STORY] Add input validation to WordGuessGame
#25
added the code to allow the user to input only a 5-letter word in word guess game
also added test cases to test more aspects of the problem to ensure proper working order
all test cases with this current issue have passed that don't need a loop (future issue)